home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / CpuMuxExceptions.h,v < prev    next >
Text File  |  1989-02-23  |  3KB  |  193 lines

  1. head     3.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.2; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 3.2
  10. date     89.02.20.15.34.05;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.1;
  13.  
  14. 3.1
  15. date     88.12.20.13.49.38;  author grunwald;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     88.10.30.13.05.36;  author grunwald;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @@
  27.  
  28.  
  29. 3.2
  30. log
  31. @Start using Gnu library heaps for schedulers
  32. @
  33. text
  34. @// This may look like C code, but it is really -*- C++ -*-
  35. // 
  36. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  37. //
  38. // written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
  39. //
  40. #ifndef CpuMuxExceptions_h
  41. #define CpuMuxExceptions_h
  42.  
  43. #include "ExceptionClass.h"
  44.  
  45. //
  46. //    ExceptionByReserve -- Used to reserve a semaphore/barrier/etc
  47. //
  48. class ReserveByException;
  49.  
  50. class ExceptionReserve : public ExceptionClass {
  51.     ReserveByException *toReserve;
  52. public:
  53.     ExceptionReserve();
  54.  
  55.     ReserveByException *reserve();
  56.     void reserve(ReserveByException *);
  57.     
  58.     virtual void handleException();
  59. };
  60.  
  61. inline
  62. ExceptionReserve::ExceptionReserve()
  63. {
  64. }
  65.  
  66. inline ReserveByException *
  67. ExceptionReserve::reserve()
  68. {
  69.     return(toReserve);
  70. }
  71.  
  72. inline void
  73. ExceptionReserve::reserve(ReserveByException *r)
  74. {
  75.     toReserve = r;
  76. }
  77.  
  78.  
  79. //
  80. //    ExceptionTerminate -- used to terminate a thread
  81. //
  82. class Thread;
  83.  
  84. class ExceptionTerminate : public ExceptionClass {
  85.     void **stackOfDeadThread;
  86. public:
  87.     ExceptionTerminate();
  88.     void terminate(void **);
  89.     virtual void handleException();
  90. };
  91.  
  92. inline
  93. ExceptionTerminate::ExceptionTerminate()
  94. {
  95. }
  96.  
  97. inline void
  98. ExceptionTerminate::terminate(void **r)
  99. {
  100.     stackOfDeadThread = r;
  101. }
  102.  
  103. //
  104. //    ExceptionReschedule -- used to relenquish the CPU. Can also be
  105. //    used to move to another CPU (i.e. previous to killing a cpu or
  106. //    spawning a CPU)
  107. //
  108.  
  109. class ExceptionReschedule : public ExceptionClass {
  110.     int newCpu;
  111. public:
  112.     ExceptionReschedule();
  113.     void cpu(int = -1);
  114.     virtual void handleException();
  115. };
  116.  
  117. inline
  118. ExceptionReschedule::ExceptionReschedule()
  119. {
  120. }
  121.  
  122. inline void
  123. ExceptionReschedule::cpu(int c)
  124. {
  125.     newCpu = c;
  126. }
  127.  
  128. //
  129. //    ExceptionIveSuspended -- used when current thread has suspended
  130. //    itself and another thread must be scheduled and run.
  131. //
  132.  
  133. class ExceptionIveSuspended : public ExceptionClass {
  134. public:
  135.     ExceptionIveSuspended();
  136.     virtual void handleException();
  137. };
  138.  
  139. inline
  140. ExceptionIveSuspended::ExceptionIveSuspended()
  141. {
  142. }
  143.  
  144. //
  145. // ExceptionEnrollDismissCpu -- enroll or dismiss a new cpu.
  146. //
  147. class ExceptionEnrollDismissCpu : public ExceptionClass {
  148.     int enrollOrDismiss;
  149. public:
  150.     void enroll();
  151.     void dismiss();
  152.     virtual void handleException();
  153. };
  154.  
  155. inline void
  156. ExceptionEnrollDismissCpu::enroll()
  157. {
  158.     enrollOrDismiss = 1;
  159. }
  160.  
  161. inline void
  162. ExceptionEnrollDismissCpu::dismiss()
  163. {
  164.     enrollOrDismiss = 0;
  165. }
  166.  
  167. #endif /* CpuMuxExceptions_h */
  168. @
  169.  
  170.  
  171. 3.1
  172. log
  173. @Steay version
  174. @
  175. text
  176. @@
  177.  
  178.  
  179. 1.1
  180. log
  181. @Initial revision
  182. @
  183. text
  184. @d72 2
  185. a73 1
  186. //    used to move to another CPU (i.e. previous to killing a cpu)
  187. d89 6
  188. d97 1
  189. a97 1
  190. //    itself an another thread must be run.
  191. d109 23
  192. @
  193.